<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var out = 25,
            inner = {
                out: 20,
                func: function() {
                    var out = 30;
                    return this.out;
                }
            }

        //console.log(1, 2, 3) //3

        // (,) 逗号运算符会得到最后一个
        // 所以第一个括号结果 (function(){ var out = 30; return this.out;  })
        // 最后就是 (function(){ var out = 30; return this.out;  })()   这里因为没有特别的对象来调用函数，所以this指向window

        console.log((inner.func, inner.func)()); //25


        console.log(inner.func()); //20 this指向inner， inner.out == this.out
        console.log((inner.func)()); //20

        // let a = 0
        // console.log((a = 100)) //100
        console.log((inner.func = inner.func)()); //25
    </script>
</body>

</html>